home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / Projects / Questions & Answers / Q&A Programming Music / Defining tonalities < prev    next >
Lisp/Scheme  |  1998-10-26  |  2KB  |  46 lines

  1. DEFINING TONALITIES
  2.  
  3. >I'm gradually discovering what's
  4. >useful for me and making notes.  I wanted to do some things with
  5. >tonalities--perhaps you can point me to the appropriate functions?  I want
  6. >to create a tonality and then derive tonalities from that by performing
  7. >various operations to it. The idea is, I could define a variable (the
  8. >pitches or intervals of the original tonality) and reference that variable
  9. >in create-tonality including various other operations. For example,
  10. >increase each interval by one semitone (a five-tone whole-tone scale would
  11. >become a five-tone scale with each step being 1.5 tones).  Then, by
  12. >changing only the definition of the original variable, I could completely
  13. >change the color of the whole score.  I thought something like
  14. >(change-length) would be useful. Is there something like that I could use
  15. >in this way?
  16.  
  17. You can use change-length or vector-round to scale a list of semitones
  18. to a new range. When you convert the vector output to a list with
  19. vector-to-list then you can use it to define a tonality.
  20.  
  21. (setq scale '(1 2 3 4 5 6))
  22.  
  23. (create-tonality normal scale)
  24. (create-tonality scaled (vector-to-list (vector-round 1 12 scale)))
  25.  
  26. (activate-tonality (normal c 3))
  27. --> ((c 3 c# 3 d 3 d# 3 e 3 f 3))
  28.  
  29. (activate-tonality (scaled c 3))
  30. --> ((c 3 d 3 e 3 g 3 a 3 b 3))
  31.  
  32. using both for two different zones
  33.  
  34. (activate-tonality (normal c 3) (scaled c 3))
  35. --> ((c 3 c# 3 d 3 d# 3 e 3 f 3) (c 3 d 3 e 3 g 3 a 3 b 3))
  36.  
  37. Or you might want to vector-mix another pattern to the scale
  38.  
  39. (create-tonality mixed (vector-to-list (vector-mix scale #(1 2 3))))
  40.  
  41. (vector-to-list (vector-mix scale #(1 2 3)))
  42. --> (2 4 6 5 7 9)
  43.  
  44. (activate-tonality (mixed c 3))
  45. --> ((c 3 d 3 e 3 d# 3 f 3 g 3))
  46.